function containsPoint(x1, y1, x2, y2, width, height) {
  if (x1 >= x2 && x1 <= x2 + width && y1 > y2 && y1 < y2 + height)
    return true;
  return false;
}

function overlaps(x1, y1, width1, height1, x2, y2, width2, height2) {
  if (x1 + width1 <= x2 || x1 >= x2 + width2 || y1 + height1 <= y2 || y1 >= y2 + height2)
    return false;
  return true;
};

function set() {
  var result = {};

  for (var i = 0; i < arguments.length; i++)
    result[arguments[i]] = true;

  return result;
};

function extend(superType) {
  var intermediateConstructor = function() {
  };
  intermediateConstructor.prototype = superType.prototype;
  return new intermediateConstructor();
}